package com.yuanlrc.hotel.restaurantPicture.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yuanlrc.hotel.restaurantPicture.mapper.RestaurantPictureMapper;
import com.yuanlrc.hotel.restaurantPicture.domain.RestaurantPicture;
import com.yuanlrc.hotel.restaurantPicture.service.IRestaurantPictureService;
import com.yuanlrc.common.core.text.Convert;

/**
 * 餐厅图库Service业务层处理
 * 
 * @author yuanlrc
 * @date 2020-11-18
 */
@Service
public class RestaurantPictureServiceImpl implements IRestaurantPictureService 
{
    @Autowired
    private RestaurantPictureMapper restaurantPictureMapper;

    /**
     * 查询餐厅图库
     * 
     * @param id 餐厅图库ID
     * @return 餐厅图库
     */
    @Override
    public RestaurantPicture selectRestaurantPictureById(Long id)
    {
        return restaurantPictureMapper.selectRestaurantPictureById(id);
    }

    /**
     * 查询餐厅图库列表
     * 
     * @param restaurantPicture 餐厅图库
     * @return 餐厅图库
     */
    @Override
    public List<RestaurantPicture> selectRestaurantPictureList(RestaurantPicture restaurantPicture)
    {
        return restaurantPictureMapper.selectRestaurantPictureList(restaurantPicture);
    }

    /**
     * 查询餐厅图库的最新的四条纪录,用于前台页面展示
     *
     * @param restaurantPicture 餐厅图库
     * @return 餐厅图库的前四条纪录
     */
    @Override
    public List<RestaurantPicture> selectFourRestaurantPicture(RestaurantPicture restaurantPicture) {
        return restaurantPictureMapper.selectFourRestaurantPicture(restaurantPicture);
    }

    /**
     * 新增餐厅图库
     * 
     * @param restaurantPicture 餐厅图库
     * @return 结果
     */
    @Override
    public int insertRestaurantPicture(RestaurantPicture restaurantPicture)
    {
        return restaurantPictureMapper.insertRestaurantPicture(restaurantPicture);
    }

    /**
     * 修改餐厅图库
     * 
     * @param restaurantPicture 餐厅图库
     * @return 结果
     */
    @Override
    public int updateRestaurantPicture(RestaurantPicture restaurantPicture)
    {
        return restaurantPictureMapper.updateRestaurantPicture(restaurantPicture);
    }

    /**
     * 删除餐厅图库对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRestaurantPictureByIds(String ids)
    {
        return restaurantPictureMapper.deleteRestaurantPictureByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除餐厅图库信息
     * 
     * @param id 餐厅图库ID
     * @return 结果
     */
    @Override
    public int deleteRestaurantPictureById(Long id)
    {
        return restaurantPictureMapper.deleteRestaurantPictureById(id);
    }
}
